<template>
  <div class="top_div">
    <n-grid y-gap="12" x-gap="12" :cols="val.col">
      <template v-for="item in vd.data">
        <n-gi>
          <div class="top_div-box">
            <div class="top_raid-pa2"># {{ item.top }}</div>
            <div>
              <img
                style="width: 40px; margin-right: 10px"
                :src="cfg.function.ava(item.ava)"
              />
            </div>
            <div>
              <p class="_p1">{{ item.name }}</p>
              <p class="_p2">
                <template v-if="vd?.season >= 2000">日均</template
                ><template v-else>满均</template>
                {{ parseInt(item.mdmg / (item.mcount / 3) / 10000) }} 万
              </p>
              <p class="_p3">{{ item.dmg?.toLocaleString() }}</p>
              <n-button
                style="position: absolute; right: 5px; bottom: 5px"
                size="tiny"
                @click="ct.player_dao(item.uid, vd.season, vd.guild_id)"
                >查刀</n-button
              >
            </div>
          </div>
        </n-gi>
      </template>
    </n-grid>
  </div>
</template>

<script>
import { cfg } from "@/cfg/cfg.js";

export default {
  props: {
    val: {
      required: true,
    },
    ct: {
      required: true,
    },
  },
  setup(props) {
    const ct = props.ct;
    const val = props.val;
    let vd = val.guild_user_list;
    onMounted(async () => {
      const res = await cfg.axios.get(`${cfg.url}`, {
        params: {
          t: "get/auto/gf_guild_list",
          type: "user",
          guild_id: vd.guild_id,
          season: vd.season,
        },
      });
      const data = res.data;
      vd.data = data.data;
    });

    return {
      ct,
      vd,
      val,
      cfg,
    };
  },
};
</script>
